//
//  LQCAFNetTool.h
//  PositiveCar
//
//  Created by dllo on 12/15/15.
//  Copyright © 2015 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, LQCResponseStyle) {
    LQCJSON,
    LQCXML,
    LQCDATA,
};


typedef NS_ENUM(NSUInteger, LQCRequestStyle) {
    LQCRequestJSON,
    LQCRequestString,
};

@interface LQCAFNetTool : NSObject

/**
 *  get 请求
 *
 *  @param URL          请求网址
 *  @param body         body体
 *  @param headFile     请求头
 *  @param reponseStyle 返回数据类型
 *  @param success      请求成功回调
 *  @param failure      请求失败回调
 */
+ (void)getNetWithURL:(NSString *)URL
                 body:(id)body
             headFile:(NSDictionary *)headFile
        responseStyle:(LQCResponseStyle)reponseStyle
              success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
              failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure ;

/**
 *  post 请求
 *
 *  @param url          请求网址
 *  @param body         body
 *  @param requestStyle body数据类型
 *  @param headFile     请求头
 *  @param reponseStyle 返回数据类型
 *  @param success      请求成功回调
 *  @param failure      请求失败回调
 */
+ (void)postNetWithURl:(NSString *)url
                  body:(id)body
             bodyStyle:(LQCRequestStyle)requestStyle
              headFile:(NSDictionary *)headFile
         responseStyle:(LQCResponseStyle)reponseStyle
               success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
               failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure ;


@end
